Click Here!
home account info subscribe login search My ITKnowledge FAQ/help site map contact us


 
Brief Full
 Advanced
      Search
 Search Tips
To access the contents, click the chapter and section titles.

Oracle Performance Tuning and Optimization
(Publisher: Macmillan Computer Publishing)
Author(s): Edward Whalen
ISBN: 067230886x
Publication Date: 04/01/96

Bookmark It

Search this book:
 
Previous Table of Contents Next


Sequential I/Os

Now look at the case of purely sequential I/O. Sequential I/O has a much better performance rate than random I/O because there is very little head movement involved in sequential I/O. This example looks specifically at the I/O rates of the log writer. For this example, assume the following specifications:

Measurement Average Time in Milliseconds

Average seek time 14 msec
Single-track seek time 4 msec
Average rotational latency 5 msec
Data transfer time
(1 database block: 2,048 bytes in size)
0.27 msec
Queue time 0 msec

For this example, look at how long it takes to retrieve a block of data on average. For sequential I/O, the access time is determined by a much smaller number of seeks. The number of times you have to seek is determined by when you have to go to the next track on the disk. Here are some additional specifications for the example drive:

Sectors per track 63
Number of platters 3

Because disk technology is very efficient, in a sequential I/O, the heads write or read the data to the same cylinder before moving on. For a disk with 63 sectors per track and 3 platters with 2 sides each, the total amount of data that can be written or read before a single track seek has to occur is determined as follows:

63 sectors/track * 3 platters * 2 tracks/platter * 512 bytes/sector =
193,536 bytes = 189 Kbytes

Because the log writer writes the data in chunks of LOG_BUFFER_SIZE size (which is set to four times the size of the database block size), you can say that approximately 13 blocks are written before a seek must occur. This formula approximates the average time spent seeking:

Average Seek Time = Single-Track Seek Time / 13 = 4 msec / 13 = 0.3 msecs

As you can see, the average seek time does not come into play at all with sequential I/Os. But what about the rotational latency? There is a problem there. Because the log writer fills the log buffer and then writes it out in chunks, it is unlikely that the disk heads will always be over the proper place on the disk. Therefore, rotational latency is still relevant for sequential I/O.

Now look at the sequential performance in terms of the number of I/Os per second the disk can sustain. Because the I/Os you are looking at now are 8K in size (because this is the size of the log buffer), the data transfer rate is calculated as follows:

Seconds per log buffer = 0.133 milliseconds per KB * 8 KB per buffer =
1.06 milliseconds per block

Here’s the formula to determine the data transfer rate:

Average Seek Time + Rotational Latency + Data Transfer Time + Queue Time

For this example, the data transfer rate works out like this:

0.3 msec + 5 msec + 1.06 msec + 0 msec = 6.36 msec

Therefore, the sequential I/O rate for this particular disk drive is calculated as follows:

I/O requests per second = 1 / seconds per I/O request = 1 / 6.36 msec
per I/O = 1 / 0.00636 sec per I/O = 157 I/Os per sec

Now assume that the log writer can use Asynchronous I/Os and can put enough requests in order to reduce the rotational latency. In that case, the number of I/Os increases significantly. The best possible case is one in which the log writer always writes enough data so that rotational latency is eliminated. You can do this by increasing the size of the log buffer or by enabling Asynchronous I/O on the LGWR. In this case, the maximum theoretical I/O rate is determined by using the following calculation:

Average Seek Time + Rotational Latency + Data Transfer Time + Queue Time

For this example, the calculation is as follows:

0.3 msec + 0 msec + 1.06 msec + 0 msec = 1.36 msec

Then use this formula to calculate the number of sequential I/Os per second:

I/O requests per second = 1 / seconds per I/O request = 1 / 1.36 msec
per I/O = 1 / 0.00136 sec per I/O = 735 I/Os per sec

This calculation gives the theoretical maximum number of sequential I/Os per second per disk as 735 I/Os per second per disk. Remember that these calculations are crude and don’t take into account other factors that come into play as you near the limits of the capacity of the drives (factors such as queues and disk buffers).

What is important to remember is the difference in performance you can achieve with sequential I/O versus random I/O. This performance difference is why it is so important to separate the log disks from the data disks. Because the redo log is so important to the operation of the RDBMS, you want to make sure that you can log as fast as necessary. Any delays in writing to the log volumes are reflected throughout the entire system.

Summary

This chapter explained how the physical disks operate and provided some calculations to show how the magic numbers on disk I/O rates are calculated. I want to reemphasize that these numbers are very rough and should be used as general guidelines.

The actual I/O rates you achieve depend not only on the physical disks themselves but on the disk controllers, the bus, and the operating system. As newer disks are being developed, new features are being added to improve performance.

It is important to note that the number of random I/Os you can achieve system wide depends on the number of disks you have in the system. Remember this when you are configuring your next system: Although disk drives are getting larger and faster, the increased speed does not compensate for the performance you can get with more disks.

It is usually much better to get more smaller disks than fewer larger disks. For example, a 2 gigabyte SCSI disk with a rotational speed of 4,500 RPM and an average seek time of 10 msec can achieve approximately 60 I/Os per second per disk. A 4 gigabyte SCSI disk with a rotational speed of 7,000 RPM and an average seek time of 8 msec can achieve approximately 79 I/Os per second per disk. However, two 2 gigabyte drives can support 120 random I/Os per second (compared with only 79 I/Os per second for the 4 gigabyte drive).

The next chapter takes these concepts a bit farther when you look at disk arrays.


Previous Table of Contents Next


Products |  Contact Us |  About Us |  Privacy  |  Ad Info  |  Home

Use of this site is subject to certain Terms & Conditions, Copyright © 1996-2000 EarthWeb Inc.
All rights reserved. Reproduction whole or in part in any form or medium without express written permission of EarthWeb is prohibited.